#pragma once

#include <string>

#include "CommonHeaders.h"

class Object
{
public:

	Object(GLuint vertexShader = 0, GLuint fragmentShader = 0): vertexShader(vertexShader), fragmentShader(fragmentShader)
	{
		program = glCreateProgram();

		if( vertexShader > 0 )
			glAttachShader(program, vertexShader);

		if( fragmentShader > 0 )
			glAttachShader(program, fragmentShader);

		glLinkProgram(program);
	}

	virtual ~Object(void)
	{
		 glDeleteProgram( program );
		 program = 0;
	}

	virtual void Render() = 0;
	virtual void LoadModel(std::string& xmlFileName) = 0;

	GLuint GetProgram() { return program; }

protected:
	GLuint vertexShader, fragmentShader;
	GLuint program;
};
